<template>
    <div class="swiper-container">
    <div class="swiper-wrapper">
        <div class="swiper-slide" v-for="item in list" :key="item.id">
          <img :src="item.pic" alt="">
        </div>
    </div>
    <!-- 如果需要分页器 -->
    <div class="swiper-pagination"></div>

</div>
</template>
<script>
import Swiper from 'swiper'
import 'swiper/css/swiper.css'
export default {
    data() {
        return {
        }
    },
    props:['list'],
    components:{
        
    },
  mounted(){
    new Swiper('.swiper-container',{
      loop:true,
      autoplay:true,
      pagination:{
        el:".swiper-pagination"
      }
    })
  },
  updated(){
new Swiper('.swiper-container',{
      loop:true,
      autoplay:true,
      pagination:{
        el:".swiper-pagination"
      }
    })
  }
}
</script>
<style lang="scss" >
.swiper-container{
  width: 100%;
  height: 200px;
  img{
    width: 100%;
  height: 100%;
  }
}
</style>